Food product monitoring solution

ABSTRACT

Disclosed is a method for inspecting a food product, the method includes: receiving image data representing the food product captured with an X-ray imaging unit; performing a texture analysis to image data for generating a first set of detections; performing a pattern analysis to at least part of the image data, the pattern analysis performed with a machine-learning component trained to identify objects with predefined pattern, for generating a second set of detections; generating an indication of an outcome of an inspection of the food product in accordance with a combination of the generated first set of detections and the second set of detections. Also disclosed is an apparatus and a computer program product.

TECHNICAL FIELD

The invention concerns in general the technical field of foodinspection. More particularly, the invention concerns food inspectionsystem based on image analysis.

BACKGROUND

As is commonly known food production is more and more automatednowadays. Food production lines produce food products being packed in apredetermined manner and conveyed to a transport station for deliveringthe food products to grocery stores and similar.

A quality of the food products is always a core issue in the foodproduction. This refers to an idea that the food product itself complieswith quality standards, but also that the product as a whole containsonly those elements belonging to the food product in question. Forexample, a food product may be a so-called semi-finished product whosefinalization is performed by a user. The food product may e.g. comprisethe food itself, but some further elements like spices packed e.g. inplastics which are to be included in the food product after heating.Hence, it may be essential to confirm that the food product includes allthe elements belonging to the product when exported from the factory.Equally important it is to guarantee that the food product does notcontain foreign matter not belonging to the food product itself. Suchforeign matter may have been ended up to the food product from the foodproduction line or together with the raw material used for the foodproduct.

At least some of the above mentioned issues are addressed by taking thefood products, or the raw material, at some point of a process through afood inspection device. Depending on a type of the food inspectiondevice predetermined characteristics of the food product are determinedand based on them an analysis is performed in order to determine if thefood product complies with quality standards set for the product.

Some food inspection devices in use are based on the food productimaging system including hardware and software. The imaging may be basedon using X-rays for capturing the image of the food product. Theanalysis performed to the X-ray image of the food product is achieved byidentifying the X-ray intensity differences in objects represented inthe X-ray image. On the basis of the X-ray intensity differencesanalysis it is possible, to some extent, detect if the food productcomplies with the quality standard. An example of such a food inspectiondevice is disclosed in a document U.S. Pat. No. 7,450,686B2.

By discriminating the basis of X-ray intensity differences between theobjects in the image, a challenge with the food inspection devices basedon X-rays and the analysis is that they have limited accuracy as well asin a situation that the objects are overlapping in the food product whenthe image is captured. Hence, a reliability of the inspection device inquestion is somewhat limited. In order to mitigate at least in part thedrawbacks of the existing solutions, it is necessary to introduce moresophisticated solutions for improving the reliability at least in part.

SUMMARY

The following presents a simplified summary in order to provide basicunderstanding of some aspects of various invention embodiments. Thesummary is not an extensive overview of the invention. It is neitherintended to identify key or critical elements of the invention nor todelineate the scope of the invention. The following summary merelypresents some concepts of the invention in a simplified form as aprelude to a more detailed description of exemplifying embodiments ofthe invention.

An object of the invention is to present a method, an apparatus and acomputer program product for inspecting a food product.

The objects of the invention are reached by a method, an apparatus and acomputer program product as defined by the respective independentclaims.

According to a first aspect, a method for inspecting a food product isprovided, the method comprises: receiving image data representing thefood product captured with an X-ray imaging unit; performing a textureanalysis to image data for generating a first set of detections;performing a pattern analysis to at least part of the image data, thepattern analysis performed with a machine-learning component trained toidentify objects with predefined pattern, for generating a second set ofdetections; generating an indication of an outcome of an inspection ofthe food product in accordance with a combination of the generated firstset of detections and the second set of detections.

The texture analysis may comprise a generation of a sub-set of the firstset of detections, the sub-set comprising detections having a likelihoodwithin a predetermined range.

The at least part of the image data to which the pattern analysis isperformed may correspond to the sub-set of the first set of detections.For example, an outcome of the pattern analysis performed to the sub-setof the first set of detections may be one of: the detection performedwith the texture analysis is correct, the detection performed with thetexture analysis is incorrect.

Moreover, a generation of the indication in accordance with thegenerated first set of detections and the second set of detections maybe arranged by detecting with the texture analysis objects having a sizewithin a first range and detecting with the pattern analysis objectshaving a size within a second range being at least in part smaller thanthe first range.

For example, the machine-learning component may be trained with objectdata derivable from a process by means of which the food product ismanufactured.

According to a second aspect, an apparatus for inspecting a food productis provided, the apparatus comprising: an X-ray imaging unit forgenerating image data representing the food product; a control unitarranged to: receive the image data representing the food productcaptured with an X-ray imaging unit; perform a texture analysis to theimage data for generating a first set of detections; perform a patternanalysis to at least part of the image data, the pattern analysisperformed with a machine-learning component trained to identify objectswith predefined pattern, for generating a second set of detections;generate an indication of an outcome of an inspection of the foodproduct in accordance with a combination of the generated first set ofdetections and the second set of detections.

The control unit of the apparatus may be arranged to, in the textureanalysis, generate a sub-set of the first set of detections, the sub-setcomprising detections having a likelihood within a predetermined range.

The control unit of the apparatus may be arranged to perform the patternanalysis to the at least part of the image data corresponding to thesub-set of the first set of detections. For example, the control unit ofthe apparatus may be arranged to generate, as an outcome of the patternanalysis performed to the sub-set of the first set of detections, is oneof: the detection performed with the texture analysis is correct, thedetection performed with the texture analysis is incorrect.

Moreover, the control unit of the apparatus may be arranged to perform ageneration of the indication in accordance with the generated first setof detections and the second set of detections by detecting with thetexture analysis objects having a size within a first range anddetecting with the pattern analysis objects having a size within asecond range being at least in part smaller than the first range.

For example, the machine-learning component of the control unit may bearranged to be trained with object data derivable from a process bymeans of which the food product is manufactured.

According to a third aspect, a computer program product for inspecting afood product is provided which computer program product, when executedby at least one processor, cause an apparatus to perform the methodaccording to the first aspect as described in the foregoing description.

The expression “a number of” refers herein to any positive integerstarting from one, e.g. to one, two, or three.

The expression “a plurality of” refers herein to any positive integerstarting from two, e.g. to two, three, or four.

Various exemplifying and non-limiting embodiments of the invention bothas to constructions and to methods of operation, together withadditional objects and advantages thereof, will be best understood fromthe following description of specific exemplifying and non-limitingembodiments when read in connection with the accompanying drawings.

The verbs “to comprise” and “to include” are used in this document asopen limitations that neither exclude nor require the existence ofunrecited features. The features recited in dependent claims aremutually freely combinable unless otherwise explicitly stated.Furthermore, it is to be understood that the use of “a” or “an”, i.e. asingular form, throughout this document does not exclude a plurality.

BRIEF DESCRIPTION OF FIGURES

The embodiments of the invention are illustrated by way of example, andnot by way of limitation, in the figures of the accompanying drawings.

FIG. 1 illustrates schematically a food inspection device according toan embodiment of the invention.

FIG. 2 illustrates schematically a method according to an embodiment ofthe invention.

FIG. 3 illustrates schematically a control unit according to anembodiment of the invention.

FIG. 4 illustrates schematically aspects relating to a neural networkimplementing at least a part of a method according to an embodiment ofthe present invention.

FIG. 5 illustrates schematically further aspects of the neural networkaccording to an embodiment of the present invention.

DESCRIPTION OF THE EXEMPLIFYING EMBODIMENTS

The specific examples provided in the description given below should notbe construed as limiting the scope and/or the applicability of theappended claims. Lists and groups of examples provided in thedescription given below are not exhaustive unless otherwise explicitlystated.

FIG. 1 illustrates schematically a food inspection device according toan example embodiment as a block diagram. The food inspection with theillustrated device is based on utilization of X-rays for scanningobjects input to the inspection. The food inspection device according tovarious embodiments may comprise a control unit 110 arranged toimplement control functions for driving the food inspection device. Oneor more I/O devices 120 may be coupled to the control unit 110. Somenon-limiting examples of the I/O devices 120 may be display device(s),keyboard(s), button(s), touch screen(s), loudspeaker(s), microphone(s),light source(s) and so on. Furthermore, the food inspection device maycomprise an X-ray imaging unit consisting of X-ray source 130 and X-raydetector 140. The X-ray source 130 is arranged to generate X-raysconveyed towards food product 150 under inspection. The X-ray source 130may e.g. comprise X-ray tube and collimator as well as further elements.The X-ray detector, in turn, 140 receives the X-rays at least part ofwhich travels through the food product 150 under inspection. The X-raydetector 140 comprises sensors, such as solid-state sensors, forgenerating a digital image on the object under inspection. However, theterm X-ray detector 140 shall be understood in a broad manner and anyother type of detector, such as X-ray film, may be used. In any case, atsome point the image of the food product is advantageously in a digitalform. The control unit 110 may be arranged to generate control signalswith respect to the X-ray source 130 and the X-ray detector 140 forexample for initiating a generation of X-rays and reading out image datafrom the X-ray detector 140. Still further, in some embodiments the foodinspection device may comprise a conveyor device 160 by means of whichthe food products may be input and output for inspection. A non-limitingexample of the conveyor device 160 may be a conveyor belt. The controlunit 110 may also be arranged to control the operation of the conveyordevice 160, such as moving it and stopping it e.g. in-sync with theoperation of the X-ray source 130 and the X-ray detector 140. The foodinspection device may comprise further elements and entities, such assensors for detecting a position of the food product, for enabling theoperation of the food inspection device.

Next, some further aspects are now discussed by referring to FIG. 2illustrating schematically a method according to various embodiments.For example, the control unit 110 may be arranged to control the X-rayimaging unit to perform image capturing process e.g. in response to adetection that a food product resides in an applicable position forimaging within the food inspection device. In response to the capture ofthe image the food inspection device, and especially the control unit110, may receive 210 image data representing an image of the foodproduct captured with an X-ray imaging unit. The received image data isin a form of digital data to which analysis operations may be performed.

In response to the receipt of image data the control unit 110 may bearranged to perform a texture analysis 220 to the image data receivedfrom the X-ray imaging unit. The texture analysis may be performed dueto a fact that X-rays may penetrate an object in accordance withcharacteristics of the object in question thus generating a texture inthe image representing the objects. A non-limiting example source ofdifferent textures is a variety of intensity differences in the objectunder imaging and, hence, in some example embodiments the textureanalysis may refer to intensity differences analysis. In other words,the characteristics of the object attenuate the X-ray radiation in avaried way, and as a result the X-ray detector receives a varied amountof radiation. The variation is detectable from the image as a variationof textures, such as contrast, in the image. Hence, the texture, such asthe contrast, may be considered to have a relationship to the materialof the food product 150, and specifically to the characteristics of thefood product and seen as the intensity differences in the image. Hence,the texture analysis may be based on detection of objects from the imagedata having a texture differing from a reference value. As anon-limiting example, the intensity differences are represented in theimage data as the contrast. Moreover, the reference value may bedetermined in accordance with the food product under inspection. Forexample, it may be determined that if a food product complies withquality requirements all intensity difference values definable with acertain accuracy shall be below the reference value with a known imagingconfiguration. Correspondingly, the same applies with any other value orvalues selected to represent the texture. Now, if during the textureanalysis it is detected, based on information derivable from intensitydifferences in the image, that a number of portions of the image datacomprise texture values exceeding the corresponding reference value(s),it may be concluded that the quality requirements are not complied withand a generation a first set of detections may be initiated. Thegeneration of the first set of detections may refer to a generation of adata record comprising data identifying each detection in apredetermined manner. The identification of the detection may e.g.comprise, but is not limited to, expressing a portion of the image data,e.g. as a position, which generated the detection, with any other datarelating to the detection, such as value of the X-ray intensity.Naturally, such portion of the image data may be expressed as pixels orpixel areas or in any corresponding manner allowing the identificationof the portions of the image data.

Moreover, in various embodiments the texture analysis 220 may comprise afurther step in which a likelihood of correctness of a detection isdetermined. The likelihood may be calculated by applying one or morerules to the detections belonging to the first set. The number of rulesmay e.g. comprise of size, shape or intensity difference. In response tothe determination of the likelihoods of the detection a sub-set ofdetections from the first set may be established. The sub-set may e.g.be defined to comprise detection having a likelihood within somepredetermined range.

According to various embodiments a pattern analysis may also beperformed 230 to at least part of the image data. An aim of the patternanalysis is to identity objects with predetermined pattern, like ashape, from the image data. In response to an identification of anobject with a predetermined pattern from the image data a detectionunder pattern analysis may be performed. A second set of detections maybe generated, the second set of detections comprising data identifyingdetections performed under the pattern analysis. As indicated e.g. inthe FIG. 2 the pattern analysis 230 may be performed at least partlyconcurrently to the texture analysis 220. However, it is also possibleto arrange that they are performed consequently to each other.

In accordance with various embodiments the pattern analysis 230 may beperformed with a machine-learning component. The machine-learningcomponent refers to a neural network model trained with a training datato perform the pattern analysis to the image data in the food inspectiondevice. Depending on a task to which the machine-learning component istrained to the training data may be selected in accordance with theapplication environment of the food inspection machine. In other words,the training data may e.g. comprise typical patterns belonging to thefood product itself, but also patterns derivable from a food productmanufacturing process, such as patterns of parts belonging to devices inthe manufacturing chain, for example. A more detailed description of anapplicable pattern recognition process with a machine learning componentis given in a forthcoming description.

As mentioned above in some embodiments the pattern analysis may beperformed to the image data as a whole. On the other hand, in someembodiments the pattern analysis may be performed only to detectionsdisclosed in the first set of detections originating from the textureanalysis. Alternatively, in some further embodiments the patternanalysis may be performed to the sub-set of the first set of detectionsdefined on a basis of a likelihood of correctness of the detections inthe texture analysis. In the latter embodiments an outcome of thepattern analysis may e.g. be if the detection performed with the textureanalysis is correct or incorrect, for instance. In at least some thesekinds of arrangements the texture analysis 220 shall be performed atleast in part prior to the pattern analysis 230 to enable a consecutiveanalysis as disclosed.

In response to a generation of detection results from the textureanalysis 220 and the pattern analysis 230 a combined result is to begenerated (cf. step 240 in FIG. 2 ). An aim is to generate an indication250 of the inspection of the food product on a basis of the generatedfirst set of detections and the second set of detections which arecombined in step 240. Thus, the indication may be based on detectionsfrom both the first set of detections and the second set of detections,or in accordance with any combination of the these two. In variousembodiments the combining 240 may be established so that the textureanalysis is arranged to generate detections on objects having a sizewithin a first range and the pattern analysis is arranged to generateindications on objects having a size within a second range being atleast in part smaller than the first range. For example, if either oneof the analysis generates a detection, the combined result of theanalysis is that the food product under monitoring deviates fromexpected, and an indication is to be generated 250. In some otherembodiments of the invention the combined result causing the generationof the indication 250 may be defined so that the indication is generatedonly on a condition that both the texture analysis and the patternanalysis generate a detection on a basis of the same portion of theimage. Still further, in some embodiments a likelihood of thedetection(s) may be taken into account in a decision-making if theindication is to be generated or not 250.

The indication itself may be output with any applicable I/O device 120,such as by generating visual and/or audio notification on the outcome ofthe inspection as the indication. For example, the outcome may expressif the food product complies with quality standards set for the foodproduct or not.

For sake of clarity and as mentioned in the foregoing description thetexture analysis and the pattern analysis may be executed concurrentlyat least in part or consecutively to each other.

The above described method may be executed by the control unit 110 ofthe food inspection device. FIG. 3 illustrates schematically anon-limiting example of the control unit 110 as a block diagram. Severalfunctionalities may be carried out with a single physical device, e.g.all calculation procedures may be performed in a single processor ifdesired. The control unit 110 according to an example of FIG. 3comprises a main processing unit 310, a memory 320 storing at least acomputer program code 325 and a communication interface 330. The controlunit 110 may further comprise, or have access to, a storage device, aninput/output device(s). The entities belonging to the control unit 110may be connected to each other via a data bus, for example. The mainprocessing unit 310 is a processing unit comprising processor circuitryand arranged to process data within the data processing system. Thememory 320 and the communication interface 330 as well as the otherentities may include conventional components as recognized by thoseskilled in the art. The memory 320 and storage device may store datawithin the control unit 110. As said computer program code 325 mayreside in the memory 320 for implementing, for example, the method asdescribed. Accordingly, a skilled person readily recognizes that anapparatus operating as the control unit 110 may be any data processingdevice, such as a computer device, a personal computer, a servercomputer, a mobile phone, a smart phone or an Internet access device,for example Internet tablet computer.

It is worthwhile to understand that different embodiments allowdifferent parts to be carried out in different elements. For example,various processes of the food inspection device may be carried out inone or more processing devices; for example, entirely in one computerdevice, or in one server device or across multiple devices. The elementsof executed process may be implemented as a software component residingon one device or distributed across several devices, as mentioned above,for example so that the devices form a so-called cloud.

In FIG. 3 it is schematically illustrated a machine-learning component315 executable with the main processing unit 310 or with a dedicatedprocessing unit. The machine-learning component 315 is dedicated atleast to perform a pattern analysis as described in at least someexample embodiments of the invention. In other words, the operation ofthe pattern analysis may be based on so-called deep learning. Deeplearning may be considered as a sub-field of machine learning. Deeplearning may involve learning of multiple layers of nonlinear processingunits, either in supervised or in unsupervised manner. These layers forma hierarchy of layers, which may be referred to as artificial neuralnetwork. Each learned layer extracts feature representations from theinput data, where features from lower layers represent low-levelsemantics (i.e. more abstract concepts). Unsupervised learningapplications may include pattern analysis (e.g. clustering, featureextraction) whereas supervised learning applications may includeclassification of image objects in the task of the pattern analysis.

Generally speaking, deep learning techniques allow for recognizing anddetecting objects in images with great accuracy, outperforming previousmethods. One difference of deep learning image recognition, or analysis,technique compared to previous methods is learning to recognize imageobjects directly from the raw image data, whereas previous techniquesare based on recognizing the image objects from hand-engineered features(e.g. SIFT features). During the training stage, deep learningtechniques build hierarchical layers which extract features ofincreasingly abstract level.

In order to achieve the neural network to perform a pattern analysis forthe task of food inspection, it needs to be prepared for the task. FIG.4 illustrates schematically aspects relating to a neural networkarranged to perform a pattern analysis at least in part. The neuralnetwork may e.g. be a Convolutional Neural Network (CNN) for a purposeof the present invention. More specifically, FIG. 4 illustratesschematically aspects relating to a training of the neural network aswell as aspects of testing the CNN. As a preliminary requirement is toset up 410 a convolutional network to be trained. This may be achievedby reading input configuration data based on which the CNN may becreated. Now, it may be inquired from a user of a computing deviceimplementing a process of FIG. 4 if a task is to train the CNN or totest an existing CNN. The training procedure is referred with 420 inFIG. 4 whereas the testing procedure is referred with 450. The trainingprocedure 420 may comprise operations forming the training procedure420. The operations may be organized to cover a preparation phase 425and a training phase 435. In the preparation phase 425 a training datamay be read to a memory and it may be preprocessed if needed. In thetraining phase 435 the CNN is trained with the training data bymonitoring an error between an output received with known input andknown output. If the error is less than defined, the CNN model may besaved. If the error is more than allowed, the training may be continuedby updating parameters of the CNN. However, a maximum number ofiterative rounds to the training may be set and if that is reached, thetraining phase may also be discontinued. In the described manner thetraining of the CNN may be achieved.

Correspondingly, the generated Convolutional Neural Network may betested with the testing procedure 450. The testing procedure 450 mayalso comprise several operations which may e.g. be a preparation phase455 and a testing phase 465. In the preparation phase 455 the CNN isinitialized. According to an example embodiment it may e.g. be inquiredfrom a user if the testing process is intended to be performed locallyin a computing device or in a communication network together with aclient device. In both cases the data received from the test process maybe input to the CNN and the CNN is arranged to generate an output in thetesting phase 465. On the basis of the testing result it may be decidedif there is need to continue the testing procedure 450 or not.

FIG. 5 illustrates schematically a high-level example of a ConvolutionalNeural Network applicable for the task to perform pattern analysis 230.The Convolutional Neural Network receives X-ray image data as an input510, and the convolutional layers (referred with 520 a-520 n in FIG. 5 )perform convolution operations on the image data with weights sharedspatially. Pool layers, or pooling layers (referred with 530 a-530 f inFIG. 5 ), in turn, are responsible for reducing a spatial size of theconvolved feature. The sizes of the matrices in the convolutional layers520 a-520 n and in the pool layers 530 a-530 f are adjusted inaccordance with the application area in order to have an output with adesired accuracy. In FIG. 5 , some non-limiting examples of the sizes ofthe matrices are given in a context of respective layers. TheConvolutional Neural Network applicable to the task according to exampleembodiments may also comprise a first summing function 540 a, or calledas a first fusion function, and a second summing function 540 b orcalled as a fusion second function. This purpose of the first summingfunction 540 a is to combine the output convolutional features of 520 eand 530 f (where the features scale of 530 f are set to be the same as520 e by module 520 k). The main purpose of this operation is togenerate a new route of the feature description for the target object.Moreover, the second summing function 540 b performs the summingfunction for conducting a fusion operation of the likelihoodprobabilities, which are generated from the outputs of 520 j and 520 n,which are the full-connected layers of two routes, respectively. Themain purpose is to obtain a joint probability for the final decision ofdetection. As a result, i.e. as an output 550, the CNN generatesdetection result in accordance with the present invention based on thepattern recognition.

The advantage of applying neural networks in the application area offood inspection comes from the internal representation which is builtinside the layers. This representation is distributed among many unitsand is hierarchical, where complex concepts build on top of simplerconcepts. As discussed in the foregoing description with respect to FIG.4 , the neural network has two main modes of operation: learning (a.k.a.training) phase and testing phase. The learning phase is the developmentphase, where the network is learnt to perform the final task. Learningmay involve iteratively updating the weights or connections betweenunits. The testing phase is the phase in which the network actuallyperforms the task. Learning may be performed in several ways, forexample, as a supervised learning, as unsupervised learning, or areinforcement learning. In supervised learning, the network is providedwith input-output pairs, where the output is usually a label. Insupervised learning, the network is provided only with input data (andalso with output raw data in case of self-supervised training). Inreinforcement training, the supervision is sparser and less precise;instead of input-output pairs, the network gets input data and,sometimes, delayed rewards in the form of scores (e.g., −1, 0, or +1).

The invention as described by providing aspects with various embodimentsmay be applied to various tasks in the food product inspection area. Forexample, by means of the described elements it may be arranged that onlythose detections which are detected with a predetermined likelihood(e.g. 100%) are taken into account from the texture analysis. The restof the detections may be performed with the pattern analysis by applyingthe machine-learning component to at least part of the image data. Thisimplementation may operate so that the texture analysis reveals itemshaving a size exceeding a predetermined limit whereas pattern analysisreveals items having the smaller size. For achieving this, the trainingof the machine-learning component may be arranged with training datadefining objects having the smaller size than detectable with thetexture analysis.

Moreover, the solution according to the invention allows to perform thefood product inspection with food products in which there may beobjects, such as an object belonging to the food product and anotherobject being a foreign object, having intensity difference close to eachother. In such a situation the texture analysis may not generate adetection since it is challenging, or even impossible, to distinguishthe objects based on the intensity differences, but the pattern analysismay generate a detection e.g. of the foreign object. For example, a wishbone ended up to the chicken food product, such as to a package, may beidentified based on a known shape of the wish bone.

Still further, the inspection method according to the invention may beapplied in confirming that a detection made with the texture analysis iscorrect. For example, the food product may include an item which isdetected with the texture analysis. Due to the detection performed withthe texture analysis it may be considered that there is a foreign objectin the food product. In response to a detection with the textureanalysis it may be arranged that the pattern analysis is directed atleast to the portion of the image data, which generated the detection inthe texture analysis, to confirm that the detection is correct. Forexample, the machine-learning component may be trained to identify itemsbelonging to the food product, and by applying that knowledge, thepattern analysis may generate an analysis result, that the detectedobject with the texture analysis actually belongs to the food product,in cancel on that basis the detection with the texture analysis.Naturally, a rule may be set for the pattern analysis that certainpattern, i.e. item, shall be found from the food product, or otherwisean indication indicating a “false” product may be generated.

The above given use cases are non-limiting examples of applicationpossibilities of the present invention, and further use cases may beintroduced.

As becomes clear from the foregoing description at least one aim of thepresent invention is to detect objects, especially contaminants orforeign objects, from a food product represented by an X-ray image. Inaccordance with the present invention a novel fusion approach byensembling, or combining, two strategies based on low-level andhigh-level feature extraction and visual understanding. The low-levelanalysis may be based on so-called image background modeling to dealwith the middle-to-small scale inspection, while so-called high-levelanalysis may be based on the image foreground modeling to handle thesmall-to-tiny scale challenges in object detection. For sake of clarity,the expression “image background” may be considered to refer to areasoccupied by the inspected food product in the generated X-ray image.Moreover, the expression “image foreground” may be considered to referto areas occupied by the contaminants/foreign objects in the generatedX-ray image or the areas occupied by the elements for quality parametersbeing analyzed.

In order to implement the above-described approach an intelligentcomprehensive food product inspection apparatus for food production isdeveloped including X-ray imaging devices, machine vision software andintegrated automatic electrical control system. In the solution amachine-learning strategy is introduce in which different kernelizedtexture feature descriptors are used to localize the abnormalintensity/gradient changes in the X-ray image and redesigning animproved deep neuron network structure to achieve accurate and robustinspections in the images containing more challenging textures andintensity variations not being able to be managed by a texture analysis.

The specific examples provided in the description given above should notbe construed as limiting the applicability and/or the interpretation ofthe appended claims. Lists and groups of examples provided in thedescription given above are not exhaustive unless otherwise explicitlystated.

1. A method for inspecting a food product, the method comprises:receiving image data representing the food product captured with anX-ray imaging unit, performing a texture analysis to image data forgenerating a first set of detections, performing a pattern analysis toat least part of the image data, the pattern analysis performed with amachine-learning component trained to identify objects with predefinedpattern, for generating a second set of detections, generating anindication of an outcome of an inspection of the food product inaccordance with a combination of the generated first set of detectionsand the second set of detections.
 2. The method of claim 1, wherein thetexture analysis comprises a generation of a sub-set of the first set ofdetections, the sub-set comprising detections having a likelihood withina predetermined range.
 3. The method of claim 2, wherein the at leastpart of the image data to which the pattern analysis is performedcorresponds to the sub-set of the first set of detections.
 4. The methodof claim 3, wherein an outcome of the pattern analysis performed to thesub-set of the first set of detections is one of: the detectionperformed with the texture analysis is correct, the detection performedwith the texture analysis is incorrect.
 5. The method of claim 1,wherein a generation of the indication in accordance with the generatedfirst set of detections and the second set of detections is arranged bydetecting with the texture analysis objects having a size within a firstrange and detecting with the pattern analysis objects having a sizewithin a second range being at least in part smaller than the firstrange.
 6. The method of claim 1, wherein the machine-learning componentis trained with object data derivable from a process by means of whichthe food product is manufactured.
 7. An apparatus for inspecting a foodproduct, the apparatus comprising: an X-ray imaging unit for generatingimage data representing the food product, a control unit arranged to:receive the image data representing the food product captured with anX-ray imaging unit, perform a texture analysis to the image data forgenerating a first set of detections, perform a pattern analysis to atleast part of the image data, the pattern analysis performed with amachine-learning component trained to identify objects with predefinedpattern, for generating a second set of detections, generate anindication of an outcome of an inspection of the food product inaccordance with a combination of the generated first set of detectionsand the second set of detections.
 8. The apparatus of claim 7, whereinthe control unit of the apparatus is arranged to, in the textureanalysis, generate a sub-set of the first set of detections, the sub-setcomprising detections having a likelihood within a predetermined range.9. The apparatus of claim 8, wherein the control unit of the apparatusis arranged to perform the pattern analysis to the at least part of theimage data corresponding to the sub-set of the first set of detections.10. The apparatus of claim 9, wherein the control unit of the apparatusis arranged to generate, as an outcome of the pattern analysis performedto the sub-set of the first set of detections, is one of: the detectionperformed with the texture analysis is correct, the detection performedwith the texture analysis is incorrect.
 11. The apparatus of claim 7,wherein the control unit of the apparatus is arranged to perform ageneration of the indication in accordance with the generated first setof detections and the second set of detections by detecting with thetexture analysis objects having a size within a first range anddetecting with the pattern analysis objects having a size within asecond range being at least in part smaller than the first range. 12.The apparatus of claim 7, wherein the machine-learning component of thecontrol unit is arranged to be trained with object data derivable from aprocess by means of which the food product is manufactured.
 13. Acomputer program product comprising at least one non-transitorycomputer-readable storage medium having computer-executable program codeinstructions stored therein, the program code instructions beingconfigured, when the computer program product is executed on a computer,to cause the computer to at least: receive the image data representingthe food product captured with an X-ray imaging unit, perform a textureanalysis to the image data for generating a first set of detections,perform a pattern analysis to at least part of the image data, thepattern analysis performed with a machine-learning component trained toidentify objects with predefined pattern, for generating a second set ofdetections, generate an indication of an outcome of an inspection of thefood product in accordance with a combination of the generated first setof detections and the second set of detections.
 14. The method of claim2, wherein a generation of the indication in accordance with thegenerated first set of detections and the second set of detections isarranged by detecting with the texture analysis objects having a sizewithin a first range and detecting with the pattern analysis objectshaving a size within a second range being at least in part smaller thanthe first range.
 15. The method of claim 3, wherein a generation of theindication in accordance with the generated first set of detections andthe second set of detections is arranged by detecting with the textureanalysis objects having a size within a first range and detecting withthe pattern analysis objects having a size within a second range beingat least in part smaller than the first range.
 16. The method of claim4, wherein a generation of the indication in accordance with thegenerated first set of detections and the second set of detections isarranged by detecting with the texture analysis objects having a sizewithin a first range and detecting with the pattern analysis objectshaving a size within a second range being at least in part smaller thanthe first range.
 17. The method of claim 2, wherein the machine-learningcomponent is trained with object data derivable from a process by meansof which the food product is manufactured.
 18. The method of claim 3,wherein the machine-learning component is trained with object dataderivable from a process by means of which the food product ismanufactured.
 19. The method of claim 4, wherein the machine-learningcomponent is trained with object data derivable from a process by meansof which the food product is manufactured.
 20. The method of claim 5,wherein the machine-learning component is trained with object dataderivable from a process by means of which the food product ismanufactured.